package com.lemobar.pay.model.wxpay;

import com.lemobar.pay.model.wxpay.request.*;
import com.lemobar.pay.model.wxpay.response.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;

/**
 * 微信支付 接口服务
 */
public interface WxPayApi {

    /**
     * 统一下单
     */
    @POST("pay/unifiedorder")
    Call<WxPayUnifiedCreateResponse> unifiedorder(@Body WxPayUnifiedCreateRequest request);


    /**
     * 付款码支付
     * @param body
     * @return
     */
    @POST("pay/micropay")
    Call<WxPayMicroPayCreateResponse> micropay(@Body RequestBody body);

    /**
     * 订单查询
     */
    @POST("pay/orderquery")
    Call<WxPayQueryResponse> orderquery(@Body WxPayQueryRequest request);

    /**
     * 关闭订单
     */
    @POST("pay/closeorder")
    Call<WxPayCloseResponse> closeOrder(@Body WxPayCloseRequest request);


    /**
     * 申请退款
     * @param body
     * @return
     */
    @POST("secapi/pay/refund")
    Call<WxPayRefundResponse> refund(@Body RequestBody body);
    /**
     * 申请退款
     * @param body
     * @return
     */
    @POST("pay/refundquery")
    Call<WxPayRefundQueryResponse> refundQuery(@Body WxPayRefundQueryRequest body);



    /**
     * 撤销订单
     */
    @POST("secapi/pay/reverse")
    Call<WxPayReverseResponse> reverse(@Body WxPayReverseRequest request);


    /**
     * 申请沙箱密钥
     * @param body
     * @return
     */
    @POST("/sandboxnew/pay/getsignkey")
    Call<WxPaySandboxKeyResponse> getsignkey(@Body RequestBody body);


    @POST("pay/downloadbill")
    Call<ResponseBody> downloadBill(@Body RequestBody body);

    /**
     * 企业付款到用户银行卡
     * @param body
     * @return
     */
    @POST("mmpaysptrans/pay_bank")
    Call<WxPayUnifiedCreateResponse> payBank(@Body RequestBody body);











    /**
     * 备份用 *************************************
     */
    /**
     * 统一下单2 备份
     * @param body
     * @return
     */
    @POST("pay/unifiedorder")
    Call<WxPayUnifiedCreateResponse> unifiedorder2(@Body RequestBody body);



    /**
     * 订单查询
     * @param body
     * @return
     */
    @POST("pay/orderquery")
    Call<WxPayQueryResponse> orderquery2(@Body RequestBody body);
}
